﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/adminmain.master" AutoEventWireup="true" CodeFile="managerFound.aspx.cs" Inherits="admin_managerFound" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script type="text/javascript">
    function fun_confirm() {
        return confirm("你确定要删除吗?");

    }

function CheckAll(checkbox) {
        var CheckBoxes = document.getElementsByTagName("input");
        for (var i = 0; i < CheckBoxes.length; i++) {
            if (CheckBoxes[i].type == "checkbox") {
                CheckBoxes[i].checked = checkbox.checked;
            }
        }
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" BackColor="White" BorderColor="#336666" 
        BorderStyle="Double" BorderWidth="3px" CellPadding="4" DataSourceID="ObMFound" 
        GridLines="Horizontal" style="margin-top: 0px" Width="98%">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:CheckBox ID="cbCheck" runat="server" />
                </ItemTemplate>
                <HeaderTemplate>
                    <asp:CheckBox ID="cbAll" Text="全选" onclick="CheckAll(this)" runat="server" />
                </HeaderTemplate>
                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="80px" />
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="LId" SortExpression="LId" Visible="False">
                <EditItemTemplate>
                    <asp:TextBox ID="lblLid" runat="server" Text='<%# Bind("LId") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblLid" runat="server" Text='<%# Bind("LId") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="主人" SortExpression="UserId">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("User.UName") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("User.UName") %>'></asp:Label>
                </ItemTemplate>
                <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="10%" />
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:TemplateField>
            <asp:BoundField DataField="GoodsName" HeaderText="物品" 
                SortExpression="GoodsName" >
            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="18%" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField DataField="LostProperty" HeaderText="信息类型" 
                SortExpression="LostProperty" >
            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="12%" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField DataField="Address" HeaderText="地点" 
                SortExpression="Address" >
            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="18%" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField DataField="Time" HeaderText="时间" SortExpression="Time" 
                DataFormatString="{0:yyyy-MM-dd}" >
            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="18%" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="IsDel" SortExpression="IsDel" Visible="False">
                <EditItemTemplate>
                    <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("IsDel") %>' />
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("IsDel") %>' 
                        Enabled="false" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:HyperLinkField DataNavigateUrlFields="LId" 
                DataNavigateUrlFormatString="managerDetail.aspx?id={0}" 
                NavigateUrl="managerDetail.aspx" Text="详细">
            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="40px" />
            </asp:HyperLinkField>
            <asp:TemplateField>
                <ItemTemplate>
                    <a href='delete.ashx?id=<%#Eval("LId") %>&img=<%#Eval("Image")%>' onclick="return fun_confirm()">删除</a>
                </ItemTemplate>
            </asp:TemplateField>

        </Columns>
        <FooterStyle BackColor="White" ForeColor="#333333" />
        <HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="White" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F7F7F7" />
        <SortedAscendingHeaderStyle BackColor="#487575" />
        <SortedDescendingCellStyle BackColor="#E5E5E5" />
        <SortedDescendingHeaderStyle BackColor="#275353" />
    </asp:GridView>
    <br />
    <asp:LinkButton ID="LinkButton1" ForeColor="Red" runat="server" 
        onclick="LinkButton1_Click" OnClientClick="return fun_confirm()">删除选中</asp:LinkButton>
    <asp:ObjectDataSource ID="ObMFound" runat="server" SelectMethod="getAll" 
        TypeName="BLL.LostAndFound">
        <SelectParameters>
            <asp:Parameter DefaultValue="寻物启事" Name="lostproperty" Type="String" />
            <asp:Parameter DefaultValue="0" Name="pagenum" Type="Int32" />
            <asp:Parameter DefaultValue="[Time] desc" Name="ordercondition" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>

